package com.dl.tt.control;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.dl.tt.bean.User;
import com.dl.tt.service.UserService;

@Controller
public class UserLogin {

	public  UserLogin() {
		System.out.println("--------------UserLogin--------------------");
	}
	@Autowired
	private UserService userService;
	
	@RequestMapping("userlogin")
	public String userlogin(User user) {
		System.out.println("userlogin->"+user);
		boolean result = this.userService.findUserByNameAndPwd(user.getName(), user.getPassword());
		
		if(result) {
			return "ok";
		}
		
		return "error";
	}
	
	
	
	
	
	
	
	
	
	
}
